package com.lims.dao.common.impl;

import java.util.List;


import com.lims.dao.base.BaseDAOImpl;
import com.lims.dao.common.IEnPartyDAO;
import com.lims.po.common.EnParty;

public class EnPartyDAOImpl extends BaseDAOImpl<EnParty> implements IEnPartyDAO {
	private static final String className=EnPartyDAOImpl.class.toString();
	public List<EnParty> selectAll(){
		String hql="from EnParty order by pid";
		return super.ExecuteQuery(hql, className+"-->selectAll()");
	}
	public boolean saveEnParty(EnParty enParty){
		return super.saveObject(enParty, className+"-->saveEnParty(EnParty EnParty)")>0?true:false;
	}
	public boolean updateEnParty(EnParty enParty){
		return super.updateObject(enParty, className+"-->updateEnParty(EnParty EnParty)");
	}
	public boolean deleteEnParty(EnParty enParty){
		return super.deleteObject(enParty, className+"-->deleteEnParty(EnParty EnParty)");
	}
	public boolean selectEnPartyByEnPartyTitle(String EnPartyTitle){
		String hql="from EnParty where EnPartyName='"+EnPartyTitle+"'";
		return super.ExecuteQuery(hql, className+"-->selectEnPartyByEnPartyName(String EnPartyName)").size()==0?false:true;
	}
	public boolean deleteEnPartyById(int pid){
		String hql="delete from EnParty where pid="+pid;
		return super.ExecuteNonQuery(hql, className+"-->deleteEnPartyById(int pid)");
	}
	
	public EnParty selectEnPartyById(int pid) {
		return super.selectById(pid, className+"-->selectEnPartyById(int pid)");
	}
}
